﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FRL.DebtChased.Website;

namespace WebApplication.Finance.Controls
{

	/// <summary>
	/// Declaration of PageHeadingBarCtrl class
	/// </summary>
	public partial class PageHeadingBarCtrl : System.Web.UI.UserControl
	{

		/////////////////////////////////////////////////////////////
		// Attributes

		private string m_strTitle;
		public string Title
		{
			get { return m_strTitle; }
			set { m_strTitle = value; }
		}

		/////////////////////////////////////////////////////////////
		// Event handlers

		protected override void OnPreRender(EventArgs e)
		{

			// Call base-class function
			base.OnPreRender(e);

			// Format the title
			MySession mySession = MySession.BindMySession();
			if (mySession.ClientName != null)
				lbPageTitle.Text = string.Format("{0} - {1}", mySession.ClientName, m_strTitle);
			else
				lbPageTitle.Text = m_strTitle; 

		}

		protected void Page_Load(object sender, EventArgs e)
		{

			// If this is a postback...
			if (this.IsPostBack)
			{

			}
			else
			{

				// Set bar color
				pnlBar.BackColor = MyApplication.BindMyApplication().PrimaryWebColor;

			}

		}

	}

}